package test04;

import java.util.ArrayList;

public class OperateImpl1 implements Impl{
    @Override
    public void showAll(ArrayList<Student> students) {
        for (int i = 0; i < students.size(); i++) {
            Student s = students.get(i);
            System.out.println(s.toString());
        }
    }

    @Override
    public void showEverage(ArrayList<Student> students) {
        double sum = 0;
        for (int i = 0; i < students.size(); i++) {
            Student s = students.get(i);
           sum += s.getScore();
        }
        System.out.println("平均分是："+sum/students.size());
    }
}
